﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using GWEB.WebBase.Entity;
using GWEB.WebBase.Utility;
using GWEB.WebFrame.Public;

namespace GWEB.WebFrame.Models
{
    public class Course
    {
        public PageInfo Init()
        {
            PageInfo pg = new PageInfo();
            pg.SMenuId = "JX01";
            pg.TableName = "cu_TeacherCourse";
            pg.KeyFieldName = "id";        
            HttpSessionState session = System.Web.HttpContext.Current.Session;
            pg.dict = BasePage.getDict(session);            
            pg.Sop = BasePage.Grant(session, pg.SMenuId);
          
            ColumnInfo cl;
            cl = new ColumnInfo(); cl.FieldName = "courseId"; cl.HeadText = "课程";  cl.IsCheck = true; cl.Length = 10; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":请选择"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.FieldName = "className"; cl.HeadText = "班级名称"; cl.IsCheck = true; cl.Length = 50; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":必填且长度不能超过" + cl.Length; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Decimal; cl.FieldName = "studentNumber"; cl.HeadText = "学员人数"; cl.IsCheck = true; cl.Length = 10; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":必填且为整数"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.FieldName = "teacherId"; cl.HeadText = "主教老师"; cl.IsCheck = true; cl.Length = 50; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":请选择"; pg.AddColumn(cl);            
            cl = new ColumnInfo(); cl.FieldName = "teachDate"; cl.HeadText = "上课开始-结束日期"; cl.IsCheck = true; cl.Length = 50; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":请选择"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Decimal; cl.FieldName = "lineUpNumber"; cl.HeadText = "可排人数"; cl.IsCheck = true; cl.Length = 10; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":必填且为整数"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.FieldName = "week"; cl.HeadText = "星期"; cl.IsCheck = true; cl.Length = 50; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":请选择"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.FieldName = "color"; cl.HeadText = "颜色"; cl.IsCheck = true; cl.Length = 50; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":请选择"; pg.AddColumn(cl);

            return pg;
        }
    }
}